home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3259 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: Rezonet.net!news
  2. From: ray@ultimate-tech.com (Ray Dunn)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: *Pointer to Functions();   /* HELP */
  5. Date: 24 Jan 1996 21:04:05 GMT
  6. Organization: Ultimate Technographics Inc.
  7. Message-ID: <4e66s5$dvl@ns.RezoNet.NET>
  8. References: <4dvrq8$c2c@news.unicomp.net> <TANMOY.96Jan22085051@qcd.lanl.gov>
  9. NNTP-Posting-Host: 204.19.230.7
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14. In referenced article, Tanmoy Bhattacharya says...
  15. >Jerry_Gore writes: 
  16. >       void    InstallTimer0(WORD period,void far (*func)(void));
  17. ><snip>
  18. >       void far animate(void) /* I added 'far' for no good reason.   */
  19. >       {                      /* It uses that name in InstallTimer0. */ 
  20. >       /* do what ever */        
  21. >       return;
  22. >       }
  23. >
  24. >   How do I send InstallTimer0 the pointer to my function animate ???
  25. >   I tried:
  26. >
  27. >        InstallTimer0(120 , (*animate)());
  28. >
  29. >First, with the far in place, I cannot answer: the code is a syntax
  30. >error in C, and every conformant C compiler has to diagnose it as
  31. >such.
  32.  
  33. It would be pleasant if we could save a lot of people embarassment from 
  34. this continuing 'C' ANSI snobbery when they post genuine questions in 
  35. all innocence.
  36.  
  37. Unless posts *specifically* question the use of the "far", "near", etc., 
  38. keywords of that well-known flavour of 'C', and ask legitimate ANSI 'C' 
  39. based questions, then those keywords can be *ignored* for the purposes 
  40. of this group.
  41.  
  42. There is a *big* difference between someone posting a question based on 
  43. the infamous "void main(void)", or other illegal use of constructs 
  44. clearly defined in ANSI, and some posted code which contains extensions 
  45. necessary for the real world system environemnts that most of us have to 
  46. exist in when we're not just being language lawyers.
  47.  
  48. This gripe is not specifically targeted at Tanmoy, whom we should thank 
  49. for his continuing helpful responses, but he is particularly crotchetty 
  50. in this area.
  51.  
  52. >InstallTimer0(120,animate) is probably the simplest way to do what you 
  53. >want.
  54.  
  55. ...and is all that was needed to be said.
  56. -- 
  57. Ray Dunn (opinions are my own) | Phone: (514) 938 9050
  58. Montreal                       | Phax : (514) 938 5225
  59. ray@ultimate-tech.com          | Home : (514) 630 3749
  60.  
  61.